--魔尊战场
--#include "MoZun.lua" once
--夜战
--#include "NightFighting.lua" once
--龙辰秘宝
--#include "SecretTreasure.lua" once
--玛法大冒险
--#include "MulphaAdventure.lua" once
--宝藏传说
--#include "BaoZangActivity.lua" once
--补给争夺
--#include "SupplyContention.lua" once
--全民红包
--#include "NationwideRedPackets.lua" once

--#include "data\functions\Boss\DreamLandBossCommon.lua" once                         --幻境boss

--[[
function InitMoZun()
	SceneReliveDispatcher.register(MoZunConfig.sceneId, OnMoZunRelive)
	SceneLogoutDispatcher.register(MoZunConfig.sceneId, OnActLoginOutInMoZun)
	SceneDieDispatcher.register(MoZunConfig.sceneId, OnKilledInMoZun)
	SceneExitDispatcher.register(MoZunConfig.sceneId, OnExitMoZunHandler)
end


table.insert(InitFnTable, InitMoZun)
--]]





--[[
北奇夜战屏蔽，如要放开，需要修改场景ID，以免与现有功能冲突
]]
function InitNightFighting()
    SceneReliveDispatcher.register(NightFightingCfg.EnterPos[1][1], NightFightingEnterScene)

    SceneLogoutDispatcher.register(NightFightingCfg.EnterPos[1][1], NightFightingLeaveActivity)

    SceneDieDispatcher.register(NightFightingCfg.EnterPos[1][1], NightFightingActorDeath)

    SceneExitDispatcher.register(NightFightingCfg.EnterPos[1][1], NightFightingLeaveActivityHandler)
end
table.insert(InitFnTable, InitNightFighting)


--[[
龙城秘宝屏蔽，如要放开，需要修改场景ID，以免与现有功能冲突
]]
function InitSecretTreasure()
    SceneReliveDispatcher.register(SecretTreasureCfg.EnterPos[1][1], SecretTreasureEnterScene)

    SceneExitDispatcher.register(SecretTreasureCfg.EnterPos[1][1], SecretTreasureLeaveActivityHandler)

    SceneDieDispatcher.register(SecretTreasureCfg.EnterPos[1][1], SecretTreasureActorDeath)

    SceneLogoutDispatcher.register(SecretTreasureCfg.EnterPos[1][1], SecretTreasureLogoutHandler)

    SceneDeathDispatcher.register(SecretTreasureCfg.EnterPos[1][1], SecretTreasureActorDeathWithNoKiller)
end
table.insert(InitFnTable, InitSecretTreasure)

--[[
注册一些事件
]]
function ResisterMulphaAdventureProc()
    --print("ResisterMulphaAdventureProc...")
    for Idx, config in ipairs( MulphaAdventureConfig.specialRound ) do
        if config.eventType == MulphaAdventureEvent.fight or 
            config.eventType == MulphaAdventureEvent.canNotPassFight then
            SetNeedReloginFuben( config.fubenId, GlobalLuaConfig.reloginFuben.mulphaAdventureIdx, GetElemsForReLoginMulphaAdventure )
            FubenTimeoutDispatcher.register( config.fubenId, OnMulphaAdventureTimeout )             --注册场景、副本时间到后触发的事件
            SceneLogoutDispatcher.register( config.sceneId, OnLogoutMulphaAdventure )               --注册场景、副本中下线触发的事件
            SceneHandExitDispatcher.register( config.sceneId, OnMulphaAdventureExitHandler )                --离开场景处理
        end
    end

    for Idx, config in ipairs( MulphaAdventureConfig.normalRound ) do
        if config.eventType == MulphaAdventureEvent.fight or 
            config.eventType == MulphaAdventureEvent.canNotPassFight then
            SetNeedReloginFuben( config.fubenId, GlobalLuaConfig.reloginFuben.mulphaAdventureIdx, GetElemsForReLoginMulphaAdventure )
            FubenTimeoutDispatcher.register( config.fubenId, OnMulphaAdventureTimeout )             --注册场景、副本时间到后触发的事件
            SceneLogoutDispatcher.register( config.sceneId, OnLogoutMulphaAdventure )               --注册场景、副本中下线触发的事件
            SceneHandExitDispatcher.register( config.sceneId, OnMulphaAdventureExitHandler )                --离开场景处理
        end
    end
end


table.insert(InitFnTable, ResisterMulphaAdventureProc)

--[[
function InitDreamLandBoss()
    SceneLogoutDispatcher.register(DreamLandBossConfig.EnterPos[1], DreamLandBossLogoutHandler)
    SceneLogoutDispatcher.register(DreamLandBossConfig.BossScene, DreamLandBossLogoutHandler)

    SceneReliveDispatcher.register(DreamLandBossConfig.BossScene, DreamLandBossRelive)
    SceneReliveDispatcher.register(DreamLandBossConfig.EnterPos[1], DreamLandBossEnter)
end

--注册物品事件
function DreamLandBossResisterProc()
    ItemAddDispatcher.register( DreamLandBossConfig.DropItemId, DreamLandBossPickItem )             --注册获得某个道具触发的事件
    ItemRemoveDispatcher.register( DreamLandBossConfig.DropItemId, DreamLandBossDropItem )
end


table.insert(InitFnTable, InitDreamLandBoss)
table.insert(InitFnTable, DreamLandBossResisterProc)
]]

function BaoZangEventListener()
    ----[[
    SceneExitDispatcher.register(BaoZangConfig.EnterPos[1][1], BaoZangLeaveActivityHandler)
    SceneLogoutDispatcher.register(BaoZangConfig.EnterPos[1][1], BaoZangLogoutHandler)
    --]]
end

table.insert(InitFnTable, BaoZangEventListener)

function InitSupplyContention()
    SceneReliveDispatcher.register(SupplyContentionConfig.unionTeams[1].EnterPos[1], SupplyContentionRelive)

    SceneLogoutDispatcher.register(SupplyContentionConfig.unionTeams[1].EnterPos[1], SupplyContentionLeaveActivity)

    SceneDieDispatcher.register(SupplyContentionConfig.unionTeams[1].EnterPos[1], SupplyContentionActorDeath)

    SceneExitDispatcher.register(SupplyContentionConfig.unionTeams[1].EnterPos[1], SupplyContentionLeaveActivityHandler)

end

table.insert(InitFnTable, InitSupplyContention)

--[[
--全民红包新版本处理 --下个版本可以删掉
table.insert(InitFnTable, NationwideRedPacketsNewVersionFirstClear)
]]